package com.example.service;

import java.util.ArrayList;
import java.util.HashMap;

import android.os.Parcel;
import android.os.Parcelable;

import com.example.project.model.Comer;
import com.example.project.model.Valoracion;

public class ValoracionsParcelable implements Parcelable {
	
	
	private int Type;
	private String idRestaurant;
	private String		From; 
	private Valoracion valoracion;

	private ArrayList<HashMap<String, String>> valoracionsList = new ArrayList<HashMap<String, String>>();
	
	public ArrayList<HashMap<String, String>> getRestaurantsList() {
		return valoracionsList;
	}

	public void setValoracionList(
			ArrayList<HashMap<String, String>> valoracionsList) {
		this.valoracionsList = valoracionsList;
	}

	public void setId(String idRestaurant) {
		this.idRestaurant = idRestaurant;
	}
	
	public String getId(){
		return this.idRestaurant;
	}

	public int getType() {
		return Type;
	}

	public void setType(int type) {
		Type = type;
	}

	public String getFrom() {
		return From;
	}

	public void setFrom(String from) {
		From = from;
	}

	public Valoracion getValoracion() {
		return this.valoracion;
	}

	public void setValoracion(Valoracion valoracion) {
		this.valoracion = valoracion;
	}

	

	public ValoracionsParcelable(int type) {
		this.setType(type);
		this.setFrom("None");
		
	}	 
		
	public ValoracionsParcelable(int t, String f,Valoracion valoracion) {
		this.setType(t);
		this.setFrom(f);
		this.setValoracion(valoracion);
	}
	
	public ValoracionsParcelable(int t, String f,ArrayList<HashMap<String, String>> valoracionsList) {
		this.setType(t);
		this.setFrom(f);
		this.setValoracionList(valoracionsList);
	}
	
	public ValoracionsParcelable(int t, String f,String id) {
		this.setType(t);
		this.setFrom(f);
		this.setId(id);
	}
	
    public ValoracionsParcelable(Parcel source){
       
        Type = source.readInt();
        From = source.readString();
        valoracion= (Valoracion) source.readValue(Comer.class.getClassLoader());
    }
    
    public int describeContents(){
    	return 0;
    }


	public void writeToParcel(Parcel dest, int flags) {
	      dest.writeInt(Type);
	      dest.writeString(From);
	      dest.writeValue(valoracion);    
	}
	
    public static final Parcelable.Creator<  ValoracionsParcelable> CREATOR
    = new Parcelable.Creator< ValoracionsParcelable>() {
    		public   ValoracionsParcelable createFromParcel(Parcel in) {
    			return new   ValoracionsParcelable(in);
    		}

    		public   ValoracionsParcelable[] newArray(int size) {
    			return new   ValoracionsParcelable[size];
    	}
    };
	

	

}
